print('*'*30)
print("\t英雄联盟")
print('*'*30)
import random 
character  = input("请选择人物:(1.蛮王 2.盖伦 3.寒冰 4.亚索 5.猴子)")
coins = 10000
print('欢迎!{}来到英雄联盟，当前金币{}'.format(character,coins))




#拥有的武器
weapons_list = []

while True:
	choices = int(input('请选择:\n1.购买武器\n2.打仗\n3.删除武器\n4.查看武器\n5.退出游戏\n'))
	if choices == 1:
		print("欢迎来到武器库")
		weapons = [['屠龙刀',400],['98k枪',1000],['倚天剑',800],['暴风大剑',2000],['饮血剑',600]]
		for weapon in weapons:
			print(weapon[0], weapon[1],sep='    ')
		arms = input('请输入要购买的武器:')
		if arms not in  weapons_list:
			for weapon in weapons:
				if arms == weapon[0]:
					if coins >= weapon[1]:
						coins -= weapon[1]
						weapons_list.append(arms)
						print('购买成功，已获得武器{},剩余金币{}'.format(weapon[0],coins))
						break
					else:
						print('金币不足,赶快打仗挣金币')
						break
			else:
				print("输入的武器名有误")
		else:
			print("已经拥有该武器")
	if choices == 2 :
		print("欢迎来到战役模式")
		if len(weapons_list) == 0:
			print("检测到你没有武器，请选择一把武器")
		elif len(weapons_list) != 0:
			while True:
				for i in weapons_list:
					print('人物角色:{}'.format(character))
					print('拥有武器:',i)
					wuqi = input("选择武器: ")
					if wuqi in weapons_list:
						print('开始打仗')
						ran1 = random.randint(1,10)
						ran2 = random.randint(1,10)
						if ran1 > ran2:
							print('本局游戏张飞获胜，无法获得金币')
						
						elif ran1 < ran2:
							print('本局你赢了，获得500金币')
							coins += 500
							print('当前金币{}'.format(coins))
						
						else:
							print("平局，啥也没有")
				break
					
	if choices == 3:
		if weapons_list == 0:
			print('没有武器，删个鬼')
		else:
			print('人物角色:{}'.format(character))
			for i in weapons_list:
				
				print('拥有武器:',i)
			while True:
				weaponname = input('请选择你要删除的武器:')
				if weaponname in weapons_list:
					weapons_list.remove(weaponname)
					for weapon in weapons:
						if weaponname == weapon[0]:
							coins += weapon[1]
							print('已成功删除武器{},剩余金币{}'.format(weaponname,coins))
							break
					break
					
					
				else:
					print('输入的名称有误')
		
		
	if choices == 4:
		if len(weapons_list) != 0:
			print('人物角色:{}'.format(character))
			for i in weapons_list:
				
				print('拥有武器:',i)
		else:
			print("没有武器查询")
		
		
		
	if choices == 5	:
		jeishu = input("是否退出游戏（yes/no）:")
		if jeishu == 'yes':
			break		
			
	else:
		print('输入有误，请重新输入')